{% extends "base.html" %}

{% block content %}
<div class="container py-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow-sm">
                <div class="card-body">
                    <h2 class="card-title mb-4">添加体重记录</h2>
                    <form method="post">
                        <div class="mb-3">
                            <label for="weight" class="form-label">体重 (kg)</label>
                            <input type="number" class="form-control" id="weight" name="weight" 
                                   step="0.1" required min="0" max="300">
                        </div>
                        <div class="mb-3">
                            <label for="record_date" class="form-label">记录日期</label>
                            <input type="date" class="form-control" id="record_date" name="record_date" 
                                   required value="{{ today }}">
                        </div>
                        <div class="mb-3">
                            <label for="note" class="form-label">备注</label>
                            <textarea class="form-control" id="note" name="note" rows="3"></textarea>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">保存</button>
                            <a href="{{ url_for('main.weight_records') }}" class="btn btn-secondary">返回</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 